package disk;

import java.util.*;
import java.io.*;

class Verify
{
	public static void verify(Vector indPrev,Vector ind) 
	{
            try{
		BufferedReader r=new BufferedReader(new FileReader("c:\\f.txt"));
		String h="";
		Vector ver=new Vector();
		while((h=r.readLine())!=null)
		{
			if(h.startsWith("created"))	
				ver.add(h.split(" ")[1]);		
			
		}
              //  System.out.println(ver);
		System.out.println(indPrev+" "+ind);
		Iterator o=ind.iterator();
		Iterator oo=null; 
		String val="",valPre="";
			while(o.hasNext())
			{
				
				oo=indPrev.iterator();
				val= (((String)o.next()).split(" "))[2];
				while(oo.hasNext())
				
				{
						
						valPre= (((String)oo.next()).split(" "))[2];
                                               // System.out.println("ToVerify "+(valPre.split("\\.")).length+" "+val);
						if(ver.indexOf(valPre.split("\\.")[0]) < ver.indexOf(val.split("\\.")[0]))
                                                {
                                                    System.out.println("true");
                                                    Form.stats++;
                                                }
                                                else
                                                {
                                                    System.out.println("false "+valPre.split("\\.")[0]+" "+ val.split("\\.")[0]);
                                                    Form.unstats++;
                                                }
				}			
			}
            }
            catch(Exception e)
            {
                e.printStackTrace();
            }        
                System.out.println("Out of "+ (Form.stats + Form.unstats)+" "+Form.stats+" is verified successfully and "+Form.unstats+" is not verified");
	}
}